BUILD:=./build

HD_IMG_NAME:= "hd.img"

all: ${BUILD}/boot/boot.o
	$(shell rm -r $(BUILD)/$(HD_IMG_NAME))
	bximage -q -hd=16 -func=create -sectsize=512 -imgmode=flat $(BUILD)/$(HD_IMG_NAME)
	dd if=${BUILD}/boot/boot.o of=${BUILD}/$(HD_IMG_NAME) bs=512 seek=0 count=1 conv=notrunc


${BUILD}/boot/%.o: oskernel/boot/%.asm
	$(shell mkdir -p ${BUILD}/boot)
	nasm $< -o $@


clean:
	$(shell rm -r ${BUILD})

bochs:
	bochsdbg -q -f bochsrc

